<template>
  <div class="DocWard">
    <div class="headerPart">
      <router-link to='/'>
        <a-icon type="left" style="color:#fff;"/>
      </router-link>
      <span>{{msg}}</span>
    </div>

    <div class="Doc-con bodyContent">
      <div class="tab-cut">
        <span
          class="tab-tit"
          v-for="(item, index) in navList"
          :key="index"
          :class="{'active': nowIndex===index}"
          @click="handleTab(index)"
        >{{item.name}}</span>
      </div>
      <div class="tab-page">
        <swiper :options="swiperOption" ref="mySwiper">
          <swiper-slide>
            <v-DailyList></v-DailyList>
          </swiper-slide>
          <swiper-slide>
            <v-CostList></v-CostList>
          </swiper-slide>
        </swiper>
      </div>
    </div>
  </div>
</template>

<script>
// import Swiper from 'swiper'
import DailyList from './DailyList'
import CostList from './CostList'
export default {
  name: 'CostQuerys',
  components: {
    'v-DailyList': DailyList,
    'v-CostList': CostList
  },
  data () {
    let self = this
    return {
      msg: '费用查询',
      swiperOption: {
        autolay: false,
        effect: 'slide',
        loop: false,
        on: {
          slideChangeTransitionEnd (swiper) {
            self.nowIndex = this.activeIndex
          }
        }
      },
      navList: [{ name: '每日清单' }, { name: '费用清单' }],
      nowIndex: 0
    }
  },
  methods: {
    handleTab (index) {
      this.nowIndex = index
      this.swiper.slideTo(index, 300, false)
    },
    returnPre () {
      this.$router.go(-1)
    }
  },
  computed: {
    swiper () {
      return this.$refs.mySwiper.swiper
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../assets/css/variables.styl';

.DocWard {
  width: 100%;
  height: auto;
  overflow :hidden;
}

.DocWard .Doc-tit {
  display: flex;
  align-items: center;
  background-color: $bgColor;
  height: 0.98rem;
  line-height: 0.98rem;
  font-size: 0.36rem;
  color: #fff;
}

.DocWard .Doc-tit .back-icon {
  width: 0.2rem;
  height: 0.3rem;
  margin: 0 0.2rem 0 0.35rem;
}

.DocWard .Doc-con .tab-cut {
  padding: 0 0.3rem;
  border-bottom: 1px solid #e8e9ee;
  box-sizing: border-box;
  margin-bottom: 0.3rem;
}

.DocWard .Doc-con .tab-cut .tab-tit {
  margin: 0 0.3rem 0 0;
  display: inline-block;
  height: 0.85rem;
  line-height: 0.85rem;
  color: #5e7996;
}

.DocWard .Doc-con .tab-cut .tab-tit.active {
  border-bottom: 2px solid #27ae9e;
  color: #27ae9e;
}

.bodyContent {
  padding: 0 0.3rem;
}

.headerPart {
  height: 0.8rem;
  background: #27ae9e;
  color: #fff;
  text-align: left;
  line-height: 0.8rem;
  padding-left: 0.3rem;
  font-size: 0.36rem;
}

.ant-table-thead th div {
  color: #7e92ab;
  font-size: 0.28rem;
}

.ant-table-tbody td {
  color: #1c1c1c;
  font-size: 0.28rem;
}
</style>
